<template>
	<div>
		<h1>学生About</h1>
		<router-link replace active-class="active" to="/Student/News">新闻</router-link>
		<router-link replace active-class="active" to="/Student/Message">消息</router-link>
		<keep-alive :include="['News', 'Message']">
			<router-view></router-view>
		</keep-alive>
	</div>
</template>

<script>
export default {
	name: 'StudentS',
	beforeRouteEnter(to, from, next) {
		console.log('StudentS组件被触发',to);
		if (to.meta.isAuth) {
			if (localStorage.getItem('school') === 'qqq') {
				next()
			} else {
				alert('学校不对')
			}
		}
	}
}
</script>

<style scoped>
.active {
	background-color: tomato;
}
</style>